package com.cloud.wms.ui.in.entity;

import android.os.Parcel;

import com.cloud.wms.ui.main.entity.CommodityEntity;

import java.util.List;

/**
 * @Author:Chen
 * @Date: 2021-01-23 19:55
 * @Description:
 */
public class InCommodityEntity extends CommodityEntity  {
    /**
     * commodityID : 0
     * barCode : string
     * commodityCode : string
     * commodityName : string
     * totalAmount : 0
     * inventoryAmount : 0
     * memberID : 0
     * memberNo : string
     * commodityCodeList : ["string"]
     */

    private int totalAmount;
    private int inventoryAmount;
    private String memberNo;
    private String memberName;
    private List<ShelfBatchEntity> productBatchList;

    public List<ShelfBatchEntity> getProductBatchList() {
        return productBatchList;
    }

    public void setProductBatchList(List<ShelfBatchEntity> productBatchList) {
        this.productBatchList = productBatchList;
    }

    public int getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(int totalAmount) {
        this.totalAmount = totalAmount;
    }

    public int getInventoryAmount() {
        return inventoryAmount;
    }

    public void setInventoryAmount(int inventoryAmount) {
        this.inventoryAmount = inventoryAmount;
    }

    public String getMemberNo() {
        return memberNo;
    }

    public void setMemberNo(String memberNo) {
        this.memberNo = memberNo;
    }

    public String getMemberName() {
        return memberName == null ? "" : memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public InCommodityEntity() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeInt(this.totalAmount);
        dest.writeInt(this.inventoryAmount);
        dest.writeString(this.memberNo);
        dest.writeString(this.memberName);
        dest.writeTypedList(this.productBatchList);
    }

    protected InCommodityEntity(Parcel in) {
        super(in);
        this.totalAmount = in.readInt();
        this.inventoryAmount = in.readInt();
        this.memberNo = in.readString();
        this.memberName = in.readString();
        this.productBatchList = in.createTypedArrayList(ShelfBatchEntity.CREATOR);
    }

    public static final Creator<InCommodityEntity> CREATOR = new Creator<InCommodityEntity>() {
        @Override
        public InCommodityEntity createFromParcel(Parcel source) {
            return new InCommodityEntity(source);
        }

        @Override
        public InCommodityEntity[] newArray(int size) {
            return new InCommodityEntity[size];
        }
    };
}
